package modellayer;


/**
 * The class Clerk is to hold information about a given employee/clerk, of which a object is to be
 * saved in the ClerkContainer class.
 * 
 * @author Allan Eriksen, Christian Stidsborg, Andreas Rye, Casper Madsen, Stefan Bols 
 * @version 051213
 */
public class Clerk extends Person
{
    private static int counter; // This counter keeps track of how many clerk objects
                                // there has been initialized and creates an uniqe clerkNo for each clerk
    
    private int clerkNo;

    /**
     * This is the constucter for Clerk which creates an object clerk
     * @param String firstName, String lastName, String addressStreet, String addressCity, String addressZipcode
     */
	public Clerk(String firstName, String lastName, String addressStreet, String addressCity, String addressZipcode, String phone, String email)
    {
		super(firstName, lastName, addressStreet, addressCity, addressZipcode, phone, email);
        this.counter++;
        this.clerkNo = counter;              
    }

    /**
     * This is an accessor-method.
     * @return the field clerkNo
     */
    public String getClerkNo() {
    	String add = "";
		if (clerkNo < 10) {
			add = "00";
		} else if (clerkNo < 100) {
			add = "0";
		} else if (clerkNo < 1000) {
			add = "";
		} else {
			add = "err:";
		}
		return add+clerkNo;
    }
}
